package user;

import book.Book;
import book.BookList;
import operations.IOperation;

/**
 * @User: vitobo
 * @Date: 2024-05-27
 * @Description: 用户
 */

// 抽象类
public abstract class User {
    protected String name;
    protected IOperation[] iOperations;  // 只是定义数组 但是没有初始化, 没有分配内存


    public User(String name) {
        this.name = name;
    }

    public abstract int menu();

    // 操作接口数组的方法
    public void doOperation(int choice, BookList bookList){
        iOperations[choice].work(bookList);
    }
}
